package org.example.curriculum_design_6_16.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.curriculum_design_6_16.entity.pojo.Student;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
* @author 郑凯
* @description 针对表【student】的数据库操作Mapper
* @createDate 2025-06-16 09:26:01
* @Entity org.example.curriculum_design_6_16.entity.pojo.Student
*/
@Mapper
public interface StudentMapper extends BaseMapper<Student> {
    @Select("select * from student where grade = #{grade}")
    List<Student> selectStudentByGrade(Integer grade);

    @Select("select * from student where grade = #{grade} AND student_id = #{studentId}")
    Student selectStudentByGradeAndId(String studentId, Integer grade);

    @Select("select * from student where student_id = #{studentId}")
    Student selectStudentById(String studentId);
}




